package com.share.device.controller;

import com.share.common.core.web.controller.BaseController;
import com.share.common.core.web.domain.AjaxResult;
import com.share.device.service.IRegionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ZhouShuang
 * @version 17
 * @Title
 * @date 2025/10/11 下午3:52
 */
@Tag(name = "地区信息接口管理")
@RestController
@RequiredArgsConstructor
@RequestMapping("/region")
public class RegionController extends BaseController {

    private final IRegionService regionService;

    /**
     * 根据上级code获取下级数据列表
     * @param parentCode
     * @return
     */
    @Operation(summary = "根据上级code获取下级数据列表")
    @GetMapping("/treeSelect/{parentCode}")
    public AjaxResult treeSelect(@PathVariable String parentCode){
        return success(regionService.treeSelect(parentCode));
    }
}
